#ifndef COLOR_H_
#define COLOR_H_

#include <stdint.h>

class Color {
  public:
    Color();
    // Initialise with red, green and blue parameters.
    Color(double red, double green, double blue);
    // Initialise from integer in R8G8B8 format.
    explicit Color(int rgb);

    // Channel accessors.
    inline double red() const;
    inline double green() const;
    inline double blue() const;

    // Add two colors. Assumes they have already been scaled!
    Color operator+(const Color& rhs) const;

  private:
    double red_;
    double green_;
    double blue_;
};

Color operator*(double k, const Color& color);

// Returns the red component.
double Color::red() const {
  return red_;
}

// Returns the green component.
double Color::green() const {
  return green_;
}

// Returns the blue component.
double Color::blue() const {
  return blue_;
}

#endif
